package Text::Filter;

use warnings;
use strict;
use Text::Hatena;

use Text::MyFilter;

use base qw/Class::Accessor::Fast/;

__PACKAGE__->mk_accessors(qw/filter text_before text_after/);


=head1 NAME

Text::Filter - The great new Text::Filter!

=head1 VERSION

Version 0.01

=cut

our $VERSION = '0.01';

sub new {
    my $class = shift->SUPER::new( @_ > 1 ? {@_} : $_[0] );

    my $components = shift->{components};
    Text::MyFilter->load_components(@{$components});
    $class->filter(Text::MyFilter->new());

    $class;
}


=head1 SYNOPSIS

Quick summary of what the module does.

Perhaps a little code snippet.

    use Text::Filter;

    my $foo = Text::Filter->new();
    ...

=head1 EXPORT

A list of functions that can be exported.  You can delete this section
if you don't export anything, such as for a purely object-oriented module.

=head1 FUNCTIONS

=head2 function1

=cut

sub convert {
    my $self = shift;
    my $text  = shift;
    $self->text_before($text);

    $text = $self->filter->call($text);
    $self->text_after($text);

    return $self->text_after;
}

=head2 function2

=cut

=head1 AUTHOR

Akihito Takeda, C<< <takeda.akihito at gmail.com> >>

=head1 BUGS

Please report any bugs or feature requests to
C<bug-text-filter at rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Text-Filter>.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Text::Filter

You can also look for information at:

=over 4

=item * AnnoCPAN: Annotated CPAN documentation

L<http://annocpan.org/dist/Text-Filter>

=item * CPAN Ratings

L<http://cpanratings.perl.org/d/Text-Filter>

=item * RT: CPAN's request tracker

L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Text-Filter>

=item * Search CPAN

L<http://search.cpan.org/dist/Text-Filter>

=back

=head1 ACKNOWLEDGEMENTS

=head1 COPYRIGHT & LICENSE

Copyright 2007 Akihito Takeda, all rights reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut

1; # End of Text::Filter
